package swimv2.ejb.control;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import swimv2.ejb.remote.GestioneUtentiRemote;
import swimv2.ejb.entity.Utente;

@Stateless(name = "GestioneUtenti")
public class GestioneUtenti implements GestioneUtentiRemote {
	@PersistenceContext(unitName = "SWIMV2")
	private EntityManager entityManager;
	private Utente utente;

	public GestioneUtenti() {

	}

	@Override
	public byte[] getFotoProfilo(String username) {
		utente = entityManager.find(Utente.class, username);
		return utente.getFoto();
	}

}
